<template>
  <div class="other-Container">
    <div class="other-Container-seat">
      <div class="title">无座位时,接受系统调座</div>
      <nut-switch v-model="checked" @change="change"> </nut-switch>
    </div>
    <div class="other-phone">
      <div>手机号</div>

      <div>{{ info?.userPhone }}</div>
    </div>
    <nut-dialog
      title="温馨提示"
      :content="tip"
      v-model:visible="visible1"
      @cancel="onCancel"
      @ok="onOk"
      text-align="left"
    />
  </div>
</template>
<script setup>
import { ref, toRefs } from "vue";
const props = defineProps({
  info: Object,
});
const { info } = toRefs(props);
const visible1 = ref(false);
const emit = defineEmits(["getIsSeat"]);
const checked = ref(true);
const tip = ref("");
const change = (e) => {
  console.log(e);
  if (!checked.value) {
    console.log(123);
    tip.value =
      "若不选择<span style='color: #ee0a24;'>“自动换座”</span>导致您的座位被占,系统会自动退款且出票率低。建议您开启<span style='color: #ee0a24;'>“自动换座”</span>,我们会为您选择周边座位。";
    visible1.value = true;
  }
  emit("getIsSeat", e);
};
//点击取消
const onCancel = () => {
  visible1.value = false;
  checked.value = true;
};
//点击确定

const onOk = () => {
  visible1.value = false;
  checked.value = false;
};
</script>
<style lang="scss">
.other-Container {
  display: flex;
  padding: 30px 20px;
  border-radius: 15px;

  flex-direction: column;
  background-color: #fff;
  .other-Container-seat {
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    .title {
      font-size: 28px;
      font-weight: 700;
      color: #15181d;
    }
  }
  .other-phone {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24px;
    color: #858a99;
    .title {
    }
  }
}
</style>
